package com.kaifamiao.lambda;

public class PandaTest {

    public static void main(String[] args) {

        Panda p = new Panda( "小圆" );

        // PandaAssignable a = (panda,name) -> panda.setName( name ) ;
        PandaAssignable a = Panda::setName;
        a.rename( p , "小媛" );

        // PandaLoadable x = panda -> panda.getName();
        PandaLoadable x = Panda::getName;
        String name = x.load( p );
        System.out.println( name );

        Panda t = new Panda( "小美" );
        System.out.println( x.load( t ) );
        a.rename( t , "大美" );
        System.out.println( x.load( t ) );

    }

}
